function userDataGrid(){
	this.numRows = 1;
	this.numColumns = 1;
	this.div = null;
	this.table = null;
	this.lastCol = null;
	this.lastRow = null;
	this.init = function(divname){
		this.div = document.getElementById(divname);
		if(!this.div)
			return;
		this.table = document.createElement('table');
		this.table.setAttribute('id','newtable');
		
		var headerrow = document.createElement('tr');
		var nullcell = document.createElement('td');
		headerrow.appendChild(nullcell);
		var firstColumnCell = document.createElement('td');
		var input=document.createTextNode();
		input.style.fontWeight = 'bold';
		this.lastCol = input;
		this.lastRow = input;
		// add an event for lastCol
		firstColumnCell.appendChild(this.lastCol);
		headderrow.appendChild(firstColumnCell);
		this.table.appendChild(headerrow);
		
		this.div.appendChild(this.table);
		
	}
	this.lastColumnEntered = function(evt){
		var headerCol = document.createElement('td');
		headerCol.style.fontWeight = 'bold';
		this.table.rows[0].appendChild(headerCol);
		this.lastCol = headerCol;
		for (i = 1; i < this.table.rows.length; i++) {
			var cell = createInputCell();
			this.table.rows[i].appendChild(cell);
		}
	}
	// create DIV element and append to the table cell
	function createInputCell() {
	    var td = document.createElement('td');
	    var input = document.createTextNode();
	    td.appendChild(txt);
	    return td;
	}
	this.lastRowEntered = function(evt){
		var row = document.createElement('tr');
		var sidecell = document.createElement('td');
		var sideinput=document.createTextNode();
		sideinput.style.fontWeight = 'bold';
		sidecell.appendChild(sideinput);
		this.lastRow = sideinput;
		row.appendChild(sidecell);
		for(var i = 1; i<this.numColumns; i++){
			var cell = createInputCell();
			row.appendChild(cell);
		} 
		this.table.appendChild(row);
	}
}